<?php

class Kd_Db_Result extends Kd_Collection_Enumerator {

    public function __construct(){
    	parent::__construct();
    }

    public function append($row){
        $this->source[] = $row;
    }

    public function getFirstRow(){
        if(!empty($this->source)){
            return $this->source[0];
        }
        return NULL;
    }

    public function getFirstValue(){
        if(!empty($this->source) && is_array($this->source[0])){
            return current($this->source[0]);
        }
        return NULL;
    }

    public function getFieldValues($fieldName){
        $result = array();
        foreach($this as $row){
            $result[] = $row[$fieldName];
        }
        reset($this);
        return $result;
    }
}